how to get rid of javascript errors